/*++

Copyright (C) Microsoft Corporation, All Rights Reserved

Module Name:

    WpdObjectProperties.h

Abstract:

    This module contains the type definitions for the WpdObjectProperties 
    helper class used to store/retrieve Sensor properties/data
--*/

#pragma once

#define DEVICE_PROTOCOL_VALUE                             L"IP Geocoding Protocol ver 1.00"
#define DEVICE_FIRMWARE_VERSION_VALUE                     L"1.0.0.0"
#define DEVICE_POWER_LEVEL_VALUE                          100
#define DEVICE_MODEL_VALUE                                L"IP Geocoding"
#define DEVICE_FRIENDLY_NAME_VALUE                        L"IP Geocoding"
#define DEVICE_MANUFACTURER_VALUE                         L"JW Secure, Inc."
#define DEVICE_SERIAL_NUMBER_VALUE                        L"11234567890123-45676890123456"
#define DEVICE_SUPPORTS_NONCONSUMABLE_VALUE               TRUE

#define SENSOR_GPS_ID                                     L"GPS"
#define SENSOR_GPS_FRIENDLY_NAME                          L"GPS Sensor"
DEFINE_GUID(SENSOR_GPS_GUID,            0xc1208611, 0x9a7c, 0x48eb, 0x80, 0x5a, 0x2c, 0xe2, 0xd0, 0xfc, 0x94, 0xd9);

HRESULT AddSupportedPropertyKeys(LPCWSTR                        wszObjectID,
                                 IPortableDeviceKeyCollection*  pKeys);
HRESULT AddSupportedDataFieldKeys(LPCWSTR                        wszObjectID,
                                 IPortableDeviceKeyCollection*  pKeys);

VOID AddCommonPropertyKeys(IPortableDeviceKeyCollection* pKeys);
VOID AddDevicePropertyKeys(IPortableDeviceKeyCollection* pKeys);
VOID AddGpsSensorPropertyKeys(IPortableDeviceKeyCollection* pKeys);

VOID AddGpsSensorDataFieldKeys(IPortableDeviceKeyCollection* pKeys);

class WpdObjectProperties
{
public:
    WpdObjectProperties();
    virtual ~WpdObjectProperties();

    HRESULT Initialize();

    HRESULT OnGetSupportedProperties(
        __in LPWSTR  wszObjectID,
        IPortableDeviceKeyCollection** ppPortableDeviceKeyCollection
        );

    HRESULT OnGetSupportedDataFields(
        __in LPWSTR  wszObjectID,
        IPortableDeviceKeyCollection** ppPortableDeviceKeyCollection
        );

    HRESULT OnGetPropertyValues(
        __in LPWSTR  wszObjectID,
        IPortableDeviceKeyCollection* pKeys,
        IPortableDeviceValues** ppPortableDeviceValues
        );

    HRESULT OnGetDataFields(
        __in LPWSTR  wszObjectID,
        IPortableDeviceKeyCollection* pKeys,
        IPortableDeviceValues** ppPortableDeviceValues
        );

    HRESULT OnSetPropertyValues(
        __in LPWSTR  wszObjectID,
        IPortableDeviceValues* pValues,
        IPortableDeviceValues** ppResults
        );

    HRESULT OnGetAllPropertyValues(
        IPortableDeviceValues*  pParams,
        IPortableDeviceValues*  pResults
        );

    HRESULT OnGetPropertyAttributes(IPortableDeviceValues*  pParams,
                                    IPortableDeviceValues*  pResults);

    HRESULT OnDeleteProperties(IPortableDeviceValues*  pParams,
                               IPortableDeviceValues*  pResults);

private:

    HRESULT GetPropertyValuesForObject(LPCWSTR                        wszObjectID,
                                       IPortableDeviceKeyCollection*  pKeys,
                                       IPortableDeviceValues*         pValues);

    HRESULT GetDataValuesForObject(LPCWSTR                        wszObjectID,
                                       IPortableDeviceKeyCollection*  pKeys,
                                       IPortableDeviceValues*         pValues);

    HRESULT GetPropertyAttributesForObject(LPCWSTR                wszObjectID,
                                           const PROPERTYKEY&     Key,
                                           IPortableDeviceValues* pAttributes);

private:

    ULONG   m_gpsSamplingRate;
};

